﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UcUserWarningManager.ascx.cs" Inherits="TheHeGeo.UserControl.UcUserWarningManager" %>
<%@ Register TagPrefix="dx" Namespace="DevExpress.Web" Assembly="DevExpress.Web.v14.2, Version=14.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" %>

<style type="text/css">

    .dxeBase { font: 12px Tahoma, Geneva, sans-serif; }

    .auto-style1 { width: 122px; }
</style>
<div style="width: 98%">
    <script type="text/javascript">
        function OnFieldChanged(s) {
            var _value = s.GetValue() +  "@" +s.name;
            alert(_value);
            grvData.PerformCallback(_value);
        }
        
    </script>

    <table style="width: 100%;">
        <tr>
            <td class="auto-style1">
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
        </tr>
        <tr>
            <td colspan="4">
                <dx:ASPxGridView ID="grvData" ClientInstanceName ="grvData" runat="server" Width="100%" AutoGenerateColumns="False" OnRowUpdating="grvData_RowUpdating"  OnRowDeleting="grvData_RowDeleting" OnRowInserting="grvData_RowInserting" KeyFieldName="Id" OnCustomCallback="grvData_CustomCallback">
                    <Columns>
                        <dx:GridViewCommandColumn ShowClearFilterButton="True" ShowDeleteButton="True" ShowEditButton="True" ShowNewButtonInHeader="True" VisibleIndex="0" Width="20px" >
                            <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="True" />
                            <CellStyle HorizontalAlign="Justify" VerticalAlign="Middle">
                            </CellStyle>
                        </dx:GridViewCommandColumn>
                       <dx:GridViewDataTextColumn Caption="Id" FieldName="Id" Name="Id" Visible="False">
                        </dx:GridViewDataTextColumn>

                        <dx:GridViewDataComboBoxColumn Caption="Dự án" FieldName="MaDuAn" Name="MaDuAn" VisibleIndex="1">
                            <PropertiesComboBox>
                                <ClientSideEvents ValueChanged="function(s, e) { OnFieldChanged(s); }">    
                                </ClientSideEvents>
                            </PropertiesComboBox>    
                        </dx:GridViewDataComboBoxColumn>

                        <dx:GridViewDataComboBoxColumn Caption="Thiết bị" FieldName="MaThietBi" Name="MaThietBi" VisibleIndex="2">
                            <PropertiesComboBox>
                                <ClientSideEvents ValueChanged="function(s, e) { OnFieldChanged(s); }">    
                                </ClientSideEvents>
                            </PropertiesComboBox> 
                        </dx:GridViewDataComboBoxColumn>

                        <dx:GridViewDataComboBoxColumn Caption="Sensor" FieldName="MaSensor" Name="MaSensor" VisibleIndex="3">
                            
                        </dx:GridViewDataComboBoxColumn>
                       
                        <dx:GridViewDataComboboxColumn Caption="User" FieldName="UserName" Name="UserName" VisibleIndex="4">                           
                        </dx:GridViewDataComboboxColumn>

                    </Columns>
                    <SettingsBehavior ConfirmDelete="True" AutoFilterRowInputDelay="100" />
                    <SettingsPager PageSize="20">
                    </SettingsPager>
                    <SettingsEditing EditFormColumnCount="3">
                    </SettingsEditing>
                    <Settings ShowFilterRow="True" ShowFilterRowMenu="True" />
                    <SettingsText ConfirmDelete="Bạn có muốn xóa dòng dữ liệu này ?" />
                    <SettingsCommandButton>
                        <NewButton Text="Thêm">
                        </NewButton>
                        <UpdateButton Text="Cập nhật" ></UpdateButton>
                        <CancelButton Text="Hủy"></CancelButton>
                        <EditButton Text="Sửa"></EditButton>
                        <DeleteButton Text="Xóa">
                        </DeleteButton>
                    </SettingsCommandButton>
                </dx:ASPxGridView>
            </td>
        </tr>
        <tr>
            <td class="auto-style1">&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
        </tr>
    </table>
    </div>